package jDev.SimEngine.Implementation.Scanner;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;

import jDev.SimEngine.Interfaces.Scanner.IStockScanner;
import jDev.SimEngine.Tools.JDEV_LOG;

public class StockScannerImpl implements IStockScanner {
	ArrayList<String> corporationList;
	BufferedReader bis;
	InputStream is;
	
	public StockScannerImpl(){
		corporationList = new ArrayList<String>();
		bis = new BufferedReader(new InputStreamReader(getClass()
				.getResourceAsStream("Corporations/List.txt")));
	}

	@Override
	public void scanStockList() {
		try {
			String s;
			while (null != (s = bis.readLine())) {
				corporationList.add(s);
			}
		} catch (IOException e) {

			e.printStackTrace();
		}
		JDEV_LOG.printMSG("Stocks loaded " + corporationList);

	}

}
